package com.aidex.tina.service.impl;

import java.util.List;
import org.springframework.stereotype.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.github.pagehelper.PageInfo;
import com.aidex.common.core.domain.BaseEntity;
import com.aidex.common.core.service.BaseServiceImpl;
import com.aidex.tina.mapper.MaterialMapper;
import com.aidex.tina.domain.Material;
import com.aidex.tina.service.MaterialService;
import org.springframework.transaction.annotation.Transactional;

/**
 * 物料管理Service业务层处理
 * @author Stanfine
 * @email shanliang@outlook.com
 * @date 2022-06-08
 */
@Service
@Transactional(readOnly = true)
public class MaterialServiceImpl extends BaseServiceImpl<MaterialMapper, Material> implements MaterialService {

    private static final Logger log = LoggerFactory.getLogger(MaterialServiceImpl.class);

    /**
     * 获取单条数据
     * @param material 物料管理
     * @return 物料管理
     */
    @Override
    public Material get(Material material) {
        Material dto = super.get(material);
        return dto;
    }

    /**
     * 获取单条数据
     * @param id 物料管理id
     * @return 物料管理
     */
    @Override
    public Material get(String id) {
        Material dto = super.get(id);
        return dto;
    }

    /**
     * 查询物料管理列表
     * @param material 物料管理
     * @return 物料管理
     */
    @Override
    public List<Material> findList(Material material) {
		List<Material> materialList = super.findList(material);
        return materialList;
    }

    /**
     * 分页查询物料管理列表
     * @param material 物料管理
     * @return 物料管理
     */
    @Override
    public PageInfo<Material> findPage(Material material) {
		PageInfo<Material> page = super.findPage(material);
        return page;
    }

    /**
     * 保存物料管理
     * @param material
     * @return 结果
     */
    @Override
    public boolean save(Material material) {
        return super.save(material);
    }

    /**
     * 删除物料管理信息
     * @param material
     * @return 结果
     */
    @Override
    public boolean remove(Material material) {
        return super.remove(material);
    }

    /**
     * 批量删除物料管理
     * @param ids 需要删除的物料管理ID
     * @return 结果
     */
    @Transactional(readOnly = false)
    @Override
    public int deleteMaterialByIds(String[] ids) {
        return mapper.deleteMaterialByIds(ids, BaseEntity.DEL_FLAG_DELETE);
    }

}
